<template>
  <div class="submit_tesm_detail_box" >
    <a-card >
      <template #title>
        <a-tag type="succese">
          通过
        </a-tag>
      </template>
      <div>
        <a-comment
          author="Socrates"
          :content="submitTeamDetail?.userVO?.userProfile"
          :datetime="submitTeamDetail?.createtime">
          <template #avatar>
            <a-avatar>
              <img
                alt="avatar"
                :src="submitTeamDetail?.userVO?.userAvatar"
              />
            </a-avatar>
          </template>
        </a-comment>
      </div>
      <div style="margin-top: 20px">
        代码 | Java
        <p style="margin: 20px; max-width: 700px; max-height: 535px">
          <CodeEditor :language="submitTeamDetail.language"
                      :content="submitTeamDetail.code"
                      :editorCode="()=>''"
                      :height="461"/>
        </p>
      </div>

    </a-card>
  </div>
</template>

<script setup lang="ts">
import { onMounted, ref } from "vue";
import { QuestionSubmitControllerService } from "../../generated";
import { Message } from "@arco-design/web-vue";
import { useRoute } from "vue-router";
import CodeEditor from "@/components/CodeEditor.vue";


const route = useRoute();
const submitTeamDetail = ref({});
onMounted(async () => {
  let id = route.query?.id;
  console.log('testid', id);
  // 根据id查详细信息
  let res = await QuestionSubmitControllerService.getQuestionSubmitVoByIdUsingGet(id);
  console.log('testres', res);
  if (res.code == 0) {
    submitTeamDetail.value = res.data;
  }else {
    Message.error(res.msg);
  }
})

</script>


<style scoped>
.submit_tesm_detail_box {
  min-height: 656px;
  max-height: 656px;
}
</style>